
let HttpRouter = new(function(){
  this.ApiUrl = 'https://program.etoury.com/';
  //this.ApiUrl = 'https://stapv1.azurewebsites.net/';
  this.WeatherUrl ='https://free-api.heweather.com/v5/weather';


  /*-----用户-----*/
  this.loginUrl = this.ApiUrl + 'api/v1/users';                                   //用户登录
  this.getPraisesUrl = function (userId, praseId) {
    return this.ApiUrl + "api/v1/users/" + userId + "/praises/" + praseId;        //用户取消点赞
  }
  this.getFeedbackUrl = function (userId) {                                       //用户反馈
    return this.ApiUrl + 'api/v1/users/' + userId + '/feedback';
  }
  /* ------City----- */
  this.strategy = function (cityId){
    return this.ApiUrl + 'api/v1/cities/' + cityId;
  }
  this.spotList = function (cityId) {
    return this.ApiUrl + 'api/v1/cities/' + cityId +'/spots';
  }
  this.cityRouteList = function (cityId) {
    return this.ApiUrl + 'api/v1/cities/' + cityId +'/routes';
  }
  this.cityRoute = function (cityId, cityRouteId) {
    return this.ApiUrl + 'api/v1/cities/' + cityId + '/cityroute/' + cityRouteId;
  }
  this.cityGuideList = function (cityId, userId) {
    return this.ApiUrl + 'api/v1/cities/'+cityId+'/guides?userId='+userId;
  }
  this.guideList = this.ApiUrl + 'api/v1/cities/guides';
  this.cityContent = function (cityId) {
    return this.ApiUrl + 'api/v1/cities/' + cityId +'/content';
  }
  /* ------Content----- */
  this.passive = function (lat, lng, spotId){
    return this.ApiUrl + 'api/v1/contents/passive?lat=' + lat +'&lng=' + lng +'&spotId=' + spotId
  }
   this.homepassive = this.ApiUrl + 'api/v1/contents/homepassive';
  this.freetimeUrl = function (spotId){
    return this.ApiUrl + 'api/v1/contents/freetime?spotId=' + spotId;
  };
  this.homefreetime = this.ApiUrl + 'api/v1/contents/homefreetime';
  /* ------Location----- */
  this.locations = function(lng,lat){
    return this.ApiUrl + 'api/v1/locations?lng=' + lng + '&lat=' + lat;
  };
  /* ------Messages----- */
  this.message = this.ApiUrl + 'api/v1/messages';
  /* ------Spot----- */
  this.position = function (lat, lng){
    return this.ApiUrl + 'api/v1/spots/position?lat=' + lat + '&lng=' + lng
  };
  this.spotRoutList = function (spotId){
    return this.ApiUrl + 'api/v1/spots/spotroute/' + spotId;
  } 
  this.spotPoi = function (poiId){
    return this.ApiUrl + 'api/v1/spots/spotpois/' + poiId;
  }
  this.spotPoiList = function (spotId){
    return this.ApiUrl + 'api/v1/spots/' + spotId+'/spotpois';
  }
  this.spot = function (spotId){
    return this.ApiUrl + 'api/v1/spots/' + spotId;
  }
  //Messages 智能导游接口
  this.getMessagesUrl = function (data) {
    return this.ApiUrl + '/api/v1/messages/getresult?query=' + data.query + '&cityId=' + data.cityId + '&guideId=' + data.guideId + '&userId=' + data.userId + '&lat=' + data.lat + '&lng=' + data.lng + '&version=' + data.version;
  }
  //获取当前城市天气接口地址
  this.CityWeather=function(CityName){
    return this.WeatherUrl + '?city=' + CityName +'&key=c91e0c39e73d45618bf570f7a85b8f12';
  }

  this.homefree = function (cityId, lat, lng, guideId){
    return this.ApiUrl + 'api/v1/contents/homefreetime?cityId=' + cityId + '&lat=' + lat + '&lng=' + lng + '&guideId=' + guideId;
  }
  this.homepassive2 = function (cityId, lat, lng, guideId) {
    return this.ApiUrl + 'api/v1/contents/homepassive?cityId=' + cityId + '&lat=' + lat + '&lng=' + lng + '&guideId=' + guideId;
  }
  this.getAppIdUrl = this.ApiUrl + 'api/v1/wxlogin';

})();

module.exports = {
  httpRouter: HttpRouter
}